package com.hunter.api.help.constant;

/**
 * 定义常量
 *
 * @author Created by lfan on 2020/5/7 13:57
 */
public interface SysConstants {

    /**
     * 项目名
     */
    String APP_KEY = "hunter";

    /**
     * 40
     */
    int FORTY = 40;

    int ONE = 1;

    int TWENTY = 20;

    int ZERO = 0;

    int TWO_HUNDRED = 200;

    String CHARACTER_J = "#";

    /**
     * 年月日时分秒的格式化字符串
     */
    String YMDHMS_FORMAT = "yyyy-MM-dd HH:mm:ss";

    String PROPERTY_ID = "propertyId";

    String VALUE_ID = "valueId";

    String FOREST_CAT_ID = "forestCatId";

    /**
     * 分页相关的常量
     */
    interface PageConstant {
        int DEFAULT_PAGE_NO = ONE;
        int DEFAULT_PAGE_SIZE = TWENTY;
        int PAGE_SIZE_MAX = 1000;
    }

    /**
     * 日常使用的常量
     */
    interface SpuManagerConstant {
        int SPU_NAME_MAX_LENGTH = FORTY;
        String SPU_NAME_REGEX = Regex.CH_EN_NUM;
        int BATCH_MAX_SIZE = TWO_HUNDRED;
        /**
         * spu by cId 查询的最大条数
         */
        int MAX_SPU_LIST_SIZE = 500;
    }


    /**
     * 正则表达式相关常量
     */
    interface Regex {
        /**
         * 数字，字母，下划线的正则表达式
         */
        String LETTER_NUMBER_UNDERLINE = "[a-zA-Z0-9_]+";

        /**
         * 汉字和数字正则表达式
         */
        String CH_NUM = "^[0-9\\u4E00-\\u9FA5]+$";

        /**
         * 中、英、数字
         */
        String CH_EN_NUM = "^[a-zA-Z0-9\\u4E00-\\u9FA5]+$";
    }
}
